// 页面白名单

const whiteList = [''];

function hasPermission(url) {
	for (let i = 0; i < whiteList.length; i++) {
		if (url.indexOf(whiteList[i] != -1) || uni.getStorageSync(('token'))) {
			return true
		}
	}
	return false
}
uni.addInterceptor('redirectTo', {
	invoke(e) {
		console.log(e);
		if (!hasPermission(e.url)) {
			uni.navigateTo({
				url: '/pages/login/login'
			})
			return false
		}
		return true
	},
	success(e) {
		console.log(e);
	},
	fail(e) {
		console.log(e);
	}
})
